package main

import (
	"demo02/crawler/engine"
	"demo02/crawler/scheduler"
	"demo02/crawler/zhenai/parser"
)

func main() {

	// 简单的单任务版爬虫
	//engine.SimpleEngine.Run(engine.Request{
	//	Url:        "http://www.zhenai.com/zhenghun",
	//	Code:       "gbk",
	//	ParserFunc: parser.ParseCityList,
	//})

	// 简单的并发版爬虫
	e := engine.ConcurrentEngine{
		Scheduler:   &scheduler.Simple{},
		WorkerCount: 1,
	}
	e.Run(engine.Request{
		Url:        "http://www.zhenai.com/zhenghun",
		Code:       "gbk",
		ParserFunc: parser.ParseCityList,
	})
}
